Test Automation
Table of Contents
Overview
List of GUI testing tools
List of web testing tools
几种自动化测试方法的对比
Robot Framework的作者Pekka Klärck的PPT: http://www.slideshare.net/pekkaklarck/introduction-to-test-automation
记录和回放方式
- Benefits
- Very easy and fast to create initially
- No programming skill needed
- Problems
- Does not test anything unless checkpoints added
- Very fragile
- Often single change in UI can break all tests
- Hard to maintain
- Plenty of separate test scripts
- No modularity or reuse
- System must be ready before automation can start
- Does not support acceptance test driven development(ATDD)
- Summary
- Seldom a good approach in general
- Never a good basis for large scale automation
线性脚本
- Benefits
- Fast to create initially
- Flexible
- Can use common scripting languages
- No license costs
- Problems
- Creating tests requires programming skills
- Very fragile
- One change in the system may break all scripts
- Hard to maintain
- Plenty of test scripts
- No modularity or reuse
- Summary
- Adequate for simple tasks
- Never a good basis for large scale automation
模块化脚本
- Benefits
- Reuse of code
- Creating new tests gets faster
- Maintainability
- Changes requires fixes in smaller areas
- Driver scripts are simple
- Even novice programmers can understand and edit
- Creating new ones is not hard either
- Reuse of code
- Problems
- Building test library requires initial effort
- Takes time
- Requires programming skills
- Test data embedded into scripts
- Requires some understanding of programming
- New tests require new driver scripts
- Building test library requires initial effort
- Summary
- Good for simple tasks
- Works also in large usage if everyone who need to understand tests can program
- Not good for non-programmers
数据驱动测试
- Benefits
- Test libraries provide modularity
- Same benefits as with modular scripting
- Creating and editing existing tests is very easy
- No programming skills needed
- Maintenance responsibilities can be divided
- Testers are responsible for the test data
- Programmers are responsible for automation code
- Test libraries provide modularity
- Problems
- Test cases are similar
- For example '1 + 2 = 3' and '1 * 2 = 2'
- New kinds of tests need new driver script
- For example '1 * 2 + 3 = 6'
- Creating driver scripts requires programming skills
- Initial effort creating parsers and other reusable components can be big
- Test cases are similar
- Summary
- Good solution even for larger scale use
- New kinds of tests requiring programming is a minus
- May be an overkill for simple tests
关键字驱动测试
- Benefits
- All smae benefits as with data-driven testing
- Non-programming can create and edit tests
- Separation of test data and code
- Tests can be constructed freely from keywords
- Non-programmers can create also new kinds of tests
- With suitable keywords also data-driven tests possible
- All tests can be executed by one framework
- No need to create and maintain separate driver scripts
- All smae benefits as with data-driven testing
- Problems
- Initial effort can be really big
- But there are open source solutions available
- Initial effort can be really big
- Summary
- Very good solution for large scale use
- Use exiting solutions if you can
- May be an overkill for simple needs
How to write Good Test Cases
- robotframework guide
- Writing Maintainable Automated Acceptance Tests article by Dale H. Emery.
- How to Structure a Scalable And Maintainable Acceptance Test Suite blog post by Andreas Ebbert-Karroum.
Test books
http://book.51cto.com/art/201012/240460.htm
- Scaling Lean & Agile Development
- Practices for Scaling Lean & Agile Development